package com.wrx.club_management_backend.controller;

import com.wrx.club_management_backend.common.AjaxResult;
import com.wrx.club_management_backend.entity.ClubAchievement;
import com.wrx.club_management_backend.service.ClubAchievementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.codec.json.AbstractJackson2Decoder;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/achievement")
public class ClubAchievementController {

    @Autowired
    ClubAchievementService clubAchievementService;


    @GetMapping("/num")
    public AjaxResult num(){
        return clubAchievementService.num();
    }

    @PostMapping("/create")
    public AjaxResult create(@RequestBody ClubAchievement achievement){
        return clubAchievementService.create(achievement);
    }

    @PostMapping("/list")
    public AjaxResult list(){
        return AjaxResult.success(clubAchievementService.list());
    }
}
